﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Text;
using MpSoft.Library.BUSS.Contents;
using MpSoft.Basic.Utils;

namespace MpSoft.Web.Controls.News
{
    public partial class NewsIsHome : System.Web.UI.UserControl
    {
        #region Method

        protected string GetNewsIsHome()
        {
            var list = NewsBUSS.News_HomeOrTypical(10, true, false);
            if (list != null)
            {
                StringBuilder sb = new StringBuilder();
                sb.Append("<ul id='scroller'>");
                var _url = "";
                foreach (var obj in list)
                {
                    _url = string.Format(obj.FormatUrl, obj.NewsID);
                    sb.Append("<li><a href='" + _url + "'>" + obj.Title + "</a></li>");
                }
                sb.Append("</ul>");
                return sb.ToString();
            }
            return "";
        }

        #endregion

        #region Event

        protected void Page_Load(object sender, EventArgs e)
        {

        }

        #endregion

    }
}